package com.mango.platform.admin.service;

import com.mango.core.page.MybatisPageHelper;
import com.mango.core.page.PageRequest;
import com.mango.core.page.PageResult;
import com.mango.core.service.CurdService;
import com.mango.platform.admin.dao.SysUserMapper;
import com.mango.platform.admin.entity.SysUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class SysUserService implements CurdService<SysUser> {

    @Resource
    private SysUserMapper mapper;

    public int deleteByPrimaryKey(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    public int insert(SysUser pojo){
        return mapper.insert(pojo);
    }

    public int insertSelective(SysUser pojo){
        return mapper.insertSelective(pojo);
    }

    public int insertList(List<SysUser> pojos){
        return mapper.insertList(pojos);
    }

   public SysUser selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
   }

    public int updateByPrimaryKeySelective(SysUser record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(SysUser record) {
        return mapper.updateByPrimaryKey(record);
    }

    /**
     * @Description 查找所有用户
     * @author zcx
     * @date 2019/9/8 17:05
     * @param
     * @return java.util.List<com.mango.platform.entity.SysUser>
     **/
    public List<SysUser> findAll() {
        return mapper.findAll();
    }

    @Override
    public int save(SysUser record) {
        return 0;
    }

    @Override
    public int delete(SysUser record) {
        return 0;
    }

    @Override
    public int delete(List<SysUser> records) {
        return 0;
    }

    @Override
    public SysUser findById(Long id) {
        return null;
    }

    @Override
    public PageResult findPage(PageRequest pageRequest) {
        return MybatisPageHelper.findPage(pageRequest,mapper);
    }
}
